package org2;

import asm.org.ImplDump;

import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;

public class Bean {
    private String name="123";
    public void test()throws Exception{

        byte[] dump = ImplDump.dump();


        MethodHandles.Lookup lookup = MethodHandles.lookup();
        //        lookup.
        Class aClass = lookup.defineHiddenClass(dump,true, MethodHandles.Lookup.ClassOption.NESTMATE).lookupClass();
        Object impl = aClass.newInstance();


        Method method1 = aClass.getMethod("apply", Bean.class, int.class);

        method1.invoke(impl,new Bean(),1);
    }
}
